<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>Система Управления</title>
		<!-- Bootstrap core CSS -->
		<link th:href="@{../asserts/css/bootstrap.min.css}" rel="stylesheet">

		<!-- Custom styles for this template -->
		<link th:href="@{../asserts/css/dashboard.css}" rel="stylesheet">
		<style type="text/css">
			@-webkit-keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			@keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			.chartjs-render-monitor {
				-webkit-animation: chartjs-render-animation 0.001s;
				animation: chartjs-render-animation 0.001s;
			}

			.hidden {
				display: none !important;
			}
		</style>
	</head>

	<body>
	<div th:replace="commons/bar::topbar"></div>
		<div class="container-fluid">
			<div class="row">
				<!--引入侧边栏-->
				<div th:replace="commons/bar::sidebar(activeUri='shops')"></div>
				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<h2>Магазин</h2>
					<a style="margin-bottom: 5px" type="button" class="btn btn-outline-primary float-right" href="shop" th:href="@{/shop}">Добавлять</a>
					<div class="table-responsive">
						<table class="table table-striped table-sm">
							<thead>
								<tr>
                                    <th class="text-center">Операционная</th>
                                    <th class="text-center">Идентификатор магазина</th>
									<th class="text-center">Размер магазина</th>
									<th class="text-center">Количество рабочих</th>
									<th class="text-center">Расположение магазина</th>
									<th class="text-center">Месячная оплата</th>
									<th class="text-center">Магазинный депозит</th>
									<th class="text-center">Описание магазина</th>
								</tr>
							</thead>
							<tbody>
								<tr th:each="shop:${pageInfo.list}">
									<td class="align-middle">
										<div class="btn-group" role="group" aria-label="Basic example">
											<a type="button" class="btn btn-sm btn-primary" th:href="@{/shop/}+${shop.shopId}">Модификация</a>
											<form th:action="@{/shop/}+${shop.shopId}" method="post">
												<input type="hidden" name="_method" value="delete">
												<button type="submit" class="btn btn-sm btn-danger">Удалять</button>
											</form>

										</div>
									</td>
									<td class="align-middle text-center" th:text="${shop.shopId}"></td>
									<td class="align-middle text-center" th:text="${shop.shopSize}"></td>
									<td class="align-middle text-center" th:text="${shop.workersNumber}"></td>
									<td class="align-middle text-center" th:text="${shop.shopLocation}"></td>
									<td class="align-middle text-center" th:text="${shop.monthlyRent}"></td>
									<td class="align-middle text-center" th:text="${shop.shopDeposit}"></td>
									<td class="align-middle text-center" th:text="${shop.shopDescription}"></td>
								</tr>
							</tbody>
						</table>
                        <nav aria-label="Page navigation example">
                            <ul class="pagination justify-content-end">
                                <!-- 上一页  -->
                                <li class="page-item disabled" th:if="${pageInfo.pageNum} eq 1">
                                    <a class="page-link" href="#" tabindex="-1" aria-disabled="true" th:href="@{javaScript:void(0)}" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li class="page-item" th:if="${pageInfo.pageNum} ne 1">
                                    <a class="page-link" aria-disabled="false" th:href="@{/employees(pageNum=${pageInfo.pageNum}-1)}" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li th:each="i : ${#numbers.sequence(1, pageInfo.pages)}">
                                    <a class="page-link active" th:href="@{/employees(pageNum=${i})}" th:text="${i}" th:value="${i}"></a>
                                </li>

                                <!-- 下一页  -->
                                <!-- 当当前页码为最后一页或者最后一页为0时，隐藏下一页按钮 当当前页码不等于总页码时，跳转下一页  -->
                                <li class="page-item disabled" th:if="${(pageInfo.pageNum eq pageInfo.pages) or (pageInfo.pages eq 0)}">
                                    <a class="page-link" href="#" tabindex="-1" aria-disabled="true" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                                <li class="page-item" th:if="${pageInfo.pageNum ne pageInfo.pages}">
                                    <a class="page-link" th:href="@{/employees(pageNum=${pageInfo.pageNum}+1)}" aria-disabled="false" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                            </ul>
                        </nav>
					</div>
				</main>
			</div>
		</div>

		<!-- Bootstrap core JavaScript
    ================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script type="text/javascript" src="../../asserts/js/jquery-3.2.1.slim.min.js"></script>
		<script type="text/javascript" src="../asserts/js/popper.min.js"></script>
		<script type="text/javascript" src="../asserts/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="../asserts/js/bootstrap-datetimepicker.min.js"></script>
		<script type="text/javascript" src="../asserts/js/locales/bootstrap-datetimepicker.ru.js"></script>

		<!-- Icons -->
		<script type="text/javascript" src="../asserts/js/feather.min.js"></script>
		<script>
			feather.replace()
		</script>

		<!-- Graphs -->
		<script type="text/javascript" src="../asserts/js/Chart.min.js"></script>

		<script>
			$('#newShopModal').on('shown.bs.modal', function () {
				$('#myInput').trigger('focus')
			})
		</script>
		<script>
			$('#editModal2').on('shown.bs.modal', function () {
				$('#myInput').trigger('focus')
			})
		</script>
    <script>
        function createShop() {
            $('#shopId').val('2000'+new Date().getMilliseconds());
        }
    </script>

	</body>

</html>